package com.gitee.starblues.example.basic1.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author starBlues
 * @version 1.0
 */
@Component
@ConfigurationProperties(prefix = "basic")
public class BasicConfig {

    @Value("${name:basic}")
    private String name;

    @Value("${age:12}")
    private Integer age;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "BasicConfig{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
